<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>timer button</title>
  <link rel="stylesheet" href="./timer-button.css">
</head>
<body>
<input type="button" id="add" value="添加定时器按钮"><br>
<input type="button" id="del" value="删除定时器按钮"><br>
<div id="test">
  <!-- <input type="button" id="add" value="同意(6s)"/> -->
</div>
<script src="//apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="./timer-button.js"></script>
<script>
$(() => {
  let $btnAdd = $('#add'),
      $btnDel = $('#del');
  $btnAdd.click(() => {
    $timerBtn.show({
      container: '#test',
      title: '发送验证码',
      onClick: function() {console.log('timer button click!');}
    });
  });
  $btnDel.click(() => {
    $timerBtn.destroy();
  });
});
</script>
</body>
</html>
